﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ProjectStudy
{
    public partial class 限制文本框输入数据类型 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            int r = 0;
            //字符串只能是整型字符串
            bool a=Int32.TryParse("33",out r);

            //字符串可以是整型、日期型、布尔型、浮点型...
            int b = Convert.ToInt32(Convert.ToDouble("33.33"));

            int c = Int32.Parse("3.33");
        }
    }
}